<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>学生信息管理系统</title>
<meta name="keywords" content="" />
<meta name="description" content=" " />
<link href="__PUBLIC__/css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/css/core.css" rel="stylesheet" type="text/css" />

<!--
var URL=document.getElementById("pageURL").value;
-->

<link rel="stylesheet" href="__PUBLIC__/css/slimbox2.css" type="text/css" media="screen" /> 
<script type="text/JavaScript" src="js/slimbox2.js"></script> 
<script type="text/JavaScript" src="__FRAME__/pureAjax.js"></script> 
<style type="text/css">
    table tr{
        margin-top: 10px;
        border: 1px solid #A1EEEF;
        height: 34px;
    }
    table td{
        border: 1px solid #A1EEEF;
    }
    table{
        border: 1px solid #A1EEEF;
    }
    li:hover{
        cursor: pointer;
    }
    
#student_model_window{
    display: none;
    width:400px;
    height:300px;
    position: fixed;
    top: 100px;
    left:300px;
    background-color: #ffffff;
    border-radius:5px;
}
#student_model_close{
    position: absolute;
    top:5px;
    right:5px;
    z-index: 10000;
    width: 25px;
}
#student_model_content{
	width:400px;
	height:300px;
}
#c_pass{
	width:100px;
	height:50px;
}
#student_model_content h3{
        padding-top: 5px;
        height: 25px;
        text-align: center;
}
</style>
</head>

<body>

<div id="background">

<div id="templatemo_wrapper">
	<div id="templatemo_header">
    	<div id="site_title"><a class="site_title_a" href="">学生信息管理系统--个人档案</a><span id="changepass">点击这里修改登录密码</span><a style="margin-left:10px;font-weight: bold;font-size: 13px;" href="<{:U('Index/logout')}>">退出系统</a></div>
    </div> <!-- END of -->
    
    <div id="templatmeo_menu">
    	<ul>
        	<li><a id="base">基本信息</a></li>
            <li><a id="family">家庭信息</a></li>
            <li><a id="classjob">任职信息</a></li>
            <li><a id="by">毕业信息</a></li>
            <li><a></a></li>
		</ul>
    </div> <!-- END of -->
    
    <div id="templatemo_main">
        
        <div id="js"></div>
      
	</div> <!-- END of contact -->
    </div>
    
    <div id="templatemo_footer">
    	Copyright © 2014 计算机与信息工程系-思创软件工作室<br />
    </div>

</div>
<div id="student_model_window">
    <div id="student_model_content">
        <h3>修改个人密码</h3>
        <hr>
        <center>
            原始密码:<input type="password" name="oldpass"/><br><br>
            新&nbsp;密&nbsp;码:<input type="password" name="newpass"/><br><br>
            重复密码:<input type="password" name="renewpass"/><br><br>
            <button id="c_pass">确定</button>
        </center>
    </div>
    <button id="student_model_close">×</button>
</div>
<input id="pageURL" type="hidden" value="<{$URL}>"/>
<input id="sid" type="hidden" value="<{$sid}>"/>
<input id="mychecksid" type="hidden" value="<{$sid}>"/>
</body>
</html>
<script>
    var base=document.getElementById("base");
    var family=document.getElementById("family");
    var classjob=document.getElementById("classjob");
    var changepass=document.getElementById("changepass");
    var by=document.getElementById("by");
    var mysid=document.getElementById("sid");
    var close=document.getElementById("student_model_close");
    var URL=document.getElementById("pageURL").value;
    var student_model_window=document.getElementById("student_model_window");
    var student_model_content=document.getElementById("student_model_content");
    var oldpass=document.getElementsByName("oldpass")[0];
    var newpass=document.getElementsByName("newpass")[0];
    var renewpass=document.getElementsByName("renewpass")[0];
    var checkPass=document.getElementById("c_pass");
    var editor=new PureAjax();
    var alljspage = document.getElementById("js");
    base.onclick=function(){
        sendPost("Editor/createNewBase/sid/"+mysid.value,{method:"create"});
    }
    family.onclick=function(){

        sendPost("Editor/createNewFamily/sid/"+mysid.value,{method:"modify"});
    }
    classjob.onclick=function(){
        sendPost("Editor/createNewClassJob/sid/"+mysid.value,{});
    }
    by.onclick=function(){
		sendPost("Editor/dealByDetail/sid/"+mysid.value,{});
		alljspage.style.width="60%";
		alljspage.style.margin="0 auto";
    }
    changepass.onclick=function(){
        var bwidth=document.body.offsetWidth;
        var wwidth=400;
        student_model_window.style.left=((bwidth/2)-(wwidth/2))+"px";
        student_model_window.style.display="block";
    }
    close.onclick=function(){
        student_model_window.style.display="none";
    }
    function sendPost(_url,_data){
        editor.post({
            dataType:"html/js",
            data:_data,
            url:URL+_url,
            success:function(data){
                editor.dealJSinHTML(data,"js");
            }
        });
		alljspage.style.width="100%";
		alljspage.style.margin="0";
    }
    checkPass.onclick=function(){
        if (newpass.value==renewpass.value) {
            editor.post({
                dataType:"text",
                data:{getoldpass:oldpass.value,getnewpass:newpass.value},
                url:URL+"Request/checkpass/sid/"+mysid.value,
                success:function(data){
                    alert(data);
                }
            });
        }else{
            alert("两次输入的密码不一致!");
        }
    }
    base.click();
</script>
